// pages/my/share-info/rules-desc/rules-desc.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    screenHeight: app.globalData.safearea.height
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    const that = this;
    app.request('/api/user/groupList').then(res => {
      console.log('groupList', res.data);
      const groupList = res.data.data;
      that.setData({
        groupList: groupList
      });
    }).catch(err => {
      console.error(err);
    });
  },
  onConsult () {
    wx.showActionSheet({
      itemList: app.globalData.phoneNumber,
      success (res) {
        wx.makePhoneCall({
          phoneNumber: app.globalData.phoneNumber[res.tapIndex]
        });
      },
      fail (res) {
        console.log(res.errMsg)
      }
    })
  }
})